<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="店铺id" prop="storeId">
        <el-input
          v-model="queryParams.storeId"
          placeholder="请输入店铺id"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>

      <el-form-item>
        <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8" ref="toolbar">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          @click="handleAdd"
          v-hasPermi="['business:unboundedIndicators:add']"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['business:unboundedIndicators:edit']"
        >修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['business:unboundedIndicators:remove']"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          @click="handleExport"
          v-hasPermi="['business:unboundedIndicators:export']"
        >导出</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>
    <div ref="divTable" :style="'height:' + divHeight + 'px'">
      <el-table v-loading="loading" :data="unboundedIndicatorsList" @selection-change="handleSelectionChange">
        <el-table-column type="selection" width="55" align="center" />
        <el-table-column label="id" align="center" prop="id" />
        <el-table-column label="店铺id" align="center" prop="storeId" />
        <el-table-column label="统计日期" align="center" prop="statDate" width="180">
          <template slot-scope="scope">
            <span>{{ parseTime(scope.row.statDate, '{y}-{m}-{d}') }}</span>
          </template>
        </el-table-column>
        <el-table-column label="场景id" align="center" prop="sceneId" />
        <el-table-column label="场景名称" align="center" prop="sceneName" />
        <el-table-column label="原二级场景id" align="center" prop="originalSceneId" />
        <el-table-column label="原二级场景名称" align="center" prop="originalSceneName" />
        <el-table-column label="计划id" align="center" prop="planId" />
        <el-table-column label="计划名称" align="center" prop="planName" />
        <el-table-column label="单元id" align="center" prop="unitId" />
        <el-table-column label="单元名称" align="center" prop="unitName" />
        <el-table-column label="主体id" align="center" prop="mainBodyId" />
        <el-table-column label="主体类型" align="center" prop="mainBodyType" />
        <el-table-column label="主体名称" align="center" prop="mainBodyName" />
        <el-table-column label="展现量" align="center" prop="impressions" />
        <el-table-column label="点击量" align="center" prop="clickNumber" />
        <el-table-column label="花费" align="center" prop="spend" />
        <el-table-column label="点击率" align="center" prop="clickRatio" />
        <el-table-column label="平均点击花费" align="center" prop="averageClickSpend" />
        <el-table-column label="千次展现花费" align="center" prop="thousandShowSpend" />
        <el-table-column label="总预售成交额" align="center" prop="totalPresaleAmount" />
        <el-table-column label="总预售成交笔数" align="center" prop="totalPresaleNumber" />
        <el-table-column label="直接预售成交额" align="center" prop="directPresaleAmount" />
        <el-table-column label="直接预售成交笔数" align="center" prop="directPresaleNumber" />
        <el-table-column label="间接预售成交额" align="center" prop="indirectPresaleAmount" />
        <el-table-column label="间接预售成交笔数" align="center" prop="indirectPresaleNumber" />
        <el-table-column label="直接成交金额" align="center" prop="directAmount" />
        <el-table-column label="间接成交金额" align="center" prop="indirectAmount" />
        <el-table-column label="总成交金额" align="center" prop="totalAmount" />
        <el-table-column label="总成交笔数" align="center" prop="totalNumber" />
        <el-table-column label="直接成交笔数" align="center" prop="directNumber" />
        <el-table-column label="间接成交笔数" align="center" prop="indirectNumber" />
        <el-table-column label="点击转化率" align="center" prop="clickConversionRate" />
        <el-table-column label="投入产出比" align="center" prop="inputOutputRatio" />
        <el-table-column label="总成交成本" align="center" prop="totalTransactionCost" />
        <el-table-column label="总购物车数" align="center" prop="totalShopCartNumber" />
        <el-table-column label="直接购物车数" align="center" prop="directShopCartNumber" />
        <el-table-column label="间接购物车数" align="center" prop="indirectShopCartNumber" />
        <el-table-column label="加购率" align="center" prop="addPurchaseRatio" />
        <el-table-column label="收藏宝贝数" align="center" prop="collectGoodsNumber" />
        <el-table-column label="收藏店铺数" align="center" prop="collectStoreNumber" />
        <el-table-column label="店铺收藏成本" align="center" prop="storeCollectCost" />
        <el-table-column label="总收藏加购数" align="center" prop="totalCollectAddNumber" />
        <el-table-column label="总收藏加购成本" align="center" prop="totalCollectAddCost" />
        <el-table-column label="宝贝收藏加购数" align="center" prop="goodsCollectAddNumber" />
        <el-table-column label="宝贝收藏加购成本" align="center" prop="goodsCollectAddCost" />
        <el-table-column label="总收藏数" align="center" prop="totalCollectNumber" />
        <el-table-column label="宝贝收藏成本" align="center" prop="goodsCollectCost" />
        <el-table-column label="宝贝收藏率" align="center" prop="goodsCollectRatio" />
        <el-table-column label="加购成本" align="center" prop="addPurchaseCost" />
        <el-table-column label="拍下订单笔数" align="center" prop="orderNumber" />
        <el-table-column label="拍下订单金额" align="center" prop="orderAmount" />
        <el-table-column label="直接收藏宝贝数" align="center" prop="directCollectGoodsNumber" />
        <el-table-column label="间接收藏宝贝数" align="center" prop="indirectCollectGoodsNumber" />
        <el-table-column label="优惠券领取量" align="center" prop="couponReceiveNumber" />
        <el-table-column label="购物金充值笔数" align="center" prop="shopGoldRechargeNumber" />
        <el-table-column label="购物金充值金额" align="center" prop="shopGoldRechargeAmount" />
        <el-table-column label="旺旺咨询量" align="center" prop="wangConsultNumber" />
        <el-table-column label="引导访问量" align="center" prop="guideVisitNumber" />
        <el-table-column label="引导访问人数" align="center" prop="guideVisitPeopleNumber" />
        <el-table-column label="引导访问潜客数" align="center" prop="guideVisitPotentialNumber" />
        <el-table-column label="引导访问潜客占比" align="center" prop="guideVisitPotentialRatio" />
        <el-table-column label="入会率" align="center" prop="joinRate" />
        <el-table-column label="入会量" align="center" prop="joinNumber" />
        <el-table-column label="引导访问率" align="center" prop="guideVisitRatio" />
        <el-table-column label="深度访问量" align="center" prop="depthVisitNumber" />
        <el-table-column label="平均访问页面数" align="center" prop="averageVisitPageNumber" />
        <el-table-column label="成交新客数" align="center" prop="dealNewOrderNumber" />
        <el-table-column label="成交新客占比" align="center" prop="dealNewOrderTatio" />
        <el-table-column label="会员首购人数" align="center" prop="vipFirstBuyNumber" />
        <el-table-column label="会员成交金额" align="center" prop="vipDealAmount" />
        <el-table-column label="会员成交笔数" align="center" prop="vipDealNumber" />
        <el-table-column label="成交人数" align="center" prop="dealPeopleNumber" />
        <el-table-column label="人均成交笔数" align="center" prop="perCapitaDealNumber" />
        <el-table-column label="人均成交金额" align="center" prop="perCapitaDealAmount" />
        <el-table-column label="曝光新客数" align="center" prop="exposureNewPeopleNumber" />
        <el-table-column label="进店新客数" align="center" prop="enterNewPeopleNumber" />
        <el-table-column label="加购新客数" align="center" prop="addPurchaseNewPeopleNumber" />
        <el-table-column label="收藏新客数" align="center" prop="collectNewPeopleNumber" />
        <el-table-column label="新客支付金额" align="center" prop="newPeoplePayAmount" />
        <el-table-column label="新客点击率" align="center" prop="newPeopleClickRatio" />
        <el-table-column label="新客成交转化率" align="center" prop="newPeopleDealConversionRate" />
        <el-table-column label="自然流量转化金额" align="center" prop="natureConversionAmount" />
        <el-table-column label="自然流量曝光量" align="center" prop="natureExposure" />
        <el-table-column label="状态 正常：NORMAL 删除：DELETED 锁定：LOCKED" align="center" prop="status" />
        <el-table-column label="备注" align="center" prop="remark" />
        <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
          <template slot-scope="scope">
            <el-button
                type="text"
                icon="el-icon-edit"
                @click="handleUpdate(scope.row)"
                v-hasPermi="['business:unboundedIndicators:edit']"
            >修改</el-button>
            <el-button
                type="text"
                icon="el-icon-delete"
                @click="handleDelete(scope.row)"
                v-hasPermi="['business:unboundedIndicators:remove']"
            >删除</el-button>
          </template>
        </el-table-column>
      </el-table>

      <pagination
          v-show="total>0"
          :pageRefs="this.$refs"
          :total="total"
          :page.sync="queryParams.pageNum"
          :limit.sync="queryParams.pageSize"
          @pagination="getList"
      />
    </div>
    <!-- 添加或修改无界指标数据对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="店铺id" prop="storeId">
          <el-input v-model="form.storeId" placeholder="请输入店铺id" />
        </el-form-item>
        <el-form-item label="统计日期" prop="statDate">
          <el-date-picker clearable
            v-model="form.statDate"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择统计日期">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="场景id" prop="sceneId">
          <el-input v-model="form.sceneId" placeholder="请输入场景id" />
        </el-form-item>
        <el-form-item label="场景名称" prop="sceneName">
          <el-input v-model="form.sceneName" placeholder="请输入场景名称" />
        </el-form-item>
        <el-form-item label="原二级场景id" prop="originalSceneId">
          <el-input v-model="form.originalSceneId" placeholder="请输入原二级场景id" />
        </el-form-item>
        <el-form-item label="原二级场景名称" prop="originalSceneName">
          <el-input v-model="form.originalSceneName" placeholder="请输入原二级场景名称" />
        </el-form-item>
        <el-form-item label="计划id" prop="planId">
          <el-input v-model="form.planId" placeholder="请输入计划id" />
        </el-form-item>
        <el-form-item label="计划名称" prop="planName">
          <el-input v-model="form.planName" placeholder="请输入计划名称" />
        </el-form-item>
        <el-form-item label="单元id" prop="unitId">
          <el-input v-model="form.unitId" placeholder="请输入单元id" />
        </el-form-item>
        <el-form-item label="单元名称" prop="unitName">
          <el-input v-model="form.unitName" placeholder="请输入单元名称" />
        </el-form-item>
        <el-form-item label="主体id" prop="mainBodyId">
          <el-input v-model="form.mainBodyId" placeholder="请输入主体id" />
        </el-form-item>
        <el-form-item label="主体名称" prop="mainBodyName">
          <el-input v-model="form.mainBodyName" placeholder="请输入主体名称" />
        </el-form-item>
        <el-form-item label="展现量" prop="impressions">
          <el-input v-model="form.impressions" placeholder="请输入展现量" />
        </el-form-item>
        <el-form-item label="点击量" prop="clickNumber">
          <el-input v-model="form.clickNumber" placeholder="请输入点击量" />
        </el-form-item>
        <el-form-item label="花费" prop="spend">
          <el-input v-model="form.spend" placeholder="请输入花费" />
        </el-form-item>
        <el-form-item label="点击率" prop="clickRatio">
          <el-input v-model="form.clickRatio" placeholder="请输入点击率" />
        </el-form-item>
        <el-form-item label="平均点击花费" prop="averageClickSpend">
          <el-input v-model="form.averageClickSpend" placeholder="请输入平均点击花费" />
        </el-form-item>
        <el-form-item label="千次展现花费" prop="thousandShowSpend">
          <el-input v-model="form.thousandShowSpend" placeholder="请输入千次展现花费" />
        </el-form-item>
        <el-form-item label="总预售成交额" prop="totalPresaleAmount">
          <el-input v-model="form.totalPresaleAmount" placeholder="请输入总预售成交额" />
        </el-form-item>
        <el-form-item label="总预售成交笔数" prop="totalPresaleNumber">
          <el-input v-model="form.totalPresaleNumber" placeholder="请输入总预售成交笔数" />
        </el-form-item>
        <el-form-item label="直接预售成交额" prop="directPresaleAmount">
          <el-input v-model="form.directPresaleAmount" placeholder="请输入直接预售成交额" />
        </el-form-item>
        <el-form-item label="直接预售成交笔数" prop="directPresaleNumber">
          <el-input v-model="form.directPresaleNumber" placeholder="请输入直接预售成交笔数" />
        </el-form-item>
        <el-form-item label="间接预售成交额" prop="indirectPresaleAmount">
          <el-input v-model="form.indirectPresaleAmount" placeholder="请输入间接预售成交额" />
        </el-form-item>
        <el-form-item label="间接预售成交笔数" prop="indirectPresaleNumber">
          <el-input v-model="form.indirectPresaleNumber" placeholder="请输入间接预售成交笔数" />
        </el-form-item>
        <el-form-item label="直接成交金额" prop="directAmount">
          <el-input v-model="form.directAmount" placeholder="请输入直接成交金额" />
        </el-form-item>
        <el-form-item label="间接成交金额" prop="indirectAmount">
          <el-input v-model="form.indirectAmount" placeholder="请输入间接成交金额" />
        </el-form-item>
        <el-form-item label="总成交金额" prop="totalAmount">
          <el-input v-model="form.totalAmount" placeholder="请输入总成交金额" />
        </el-form-item>
        <el-form-item label="总成交笔数" prop="totalNumber">
          <el-input v-model="form.totalNumber" placeholder="请输入总成交笔数" />
        </el-form-item>
        <el-form-item label="直接成交笔数" prop="directNumber">
          <el-input v-model="form.directNumber" placeholder="请输入直接成交笔数" />
        </el-form-item>
        <el-form-item label="间接成交笔数" prop="indirectNumber">
          <el-input v-model="form.indirectNumber" placeholder="请输入间接成交笔数" />
        </el-form-item>
        <el-form-item label="点击转化率" prop="clickConversionRate">
          <el-input v-model="form.clickConversionRate" placeholder="请输入点击转化率" />
        </el-form-item>
        <el-form-item label="投入产出比" prop="inputOutputRatio">
          <el-input v-model="form.inputOutputRatio" placeholder="请输入投入产出比" />
        </el-form-item>
        <el-form-item label="总成交成本" prop="totalTransactionCost">
          <el-input v-model="form.totalTransactionCost" placeholder="请输入总成交成本" />
        </el-form-item>
        <el-form-item label="总购物车数" prop="totalShopCartNumber">
          <el-input v-model="form.totalShopCartNumber" placeholder="请输入总购物车数" />
        </el-form-item>
        <el-form-item label="直接购物车数" prop="directShopCartNumber">
          <el-input v-model="form.directShopCartNumber" placeholder="请输入直接购物车数" />
        </el-form-item>
        <el-form-item label="间接购物车数" prop="indirectShopCartNumber">
          <el-input v-model="form.indirectShopCartNumber" placeholder="请输入间接购物车数" />
        </el-form-item>
        <el-form-item label="加购率" prop="addPurchaseRatio">
          <el-input v-model="form.addPurchaseRatio" placeholder="请输入加购率" />
        </el-form-item>
        <el-form-item label="收藏宝贝数" prop="collectGoodsNumber">
          <el-input v-model="form.collectGoodsNumber" placeholder="请输入收藏宝贝数" />
        </el-form-item>
        <el-form-item label="收藏店铺数" prop="collectStoreNumber">
          <el-input v-model="form.collectStoreNumber" placeholder="请输入收藏店铺数" />
        </el-form-item>
        <el-form-item label="店铺收藏成本" prop="storeCollectCost">
          <el-input v-model="form.storeCollectCost" placeholder="请输入店铺收藏成本" />
        </el-form-item>
        <el-form-item label="总收藏加购数" prop="totalCollectAddNumber">
          <el-input v-model="form.totalCollectAddNumber" placeholder="请输入总收藏加购数" />
        </el-form-item>
        <el-form-item label="总收藏加购成本" prop="totalCollectAddCost">
          <el-input v-model="form.totalCollectAddCost" placeholder="请输入总收藏加购成本" />
        </el-form-item>
        <el-form-item label="宝贝收藏加购数" prop="goodsCollectAddNumber">
          <el-input v-model="form.goodsCollectAddNumber" placeholder="请输入宝贝收藏加购数" />
        </el-form-item>
        <el-form-item label="宝贝收藏加购成本" prop="goodsCollectAddCost">
          <el-input v-model="form.goodsCollectAddCost" placeholder="请输入宝贝收藏加购成本" />
        </el-form-item>
        <el-form-item label="总收藏数" prop="totalCollectNumber">
          <el-input v-model="form.totalCollectNumber" placeholder="请输入总收藏数" />
        </el-form-item>
        <el-form-item label="宝贝收藏成本" prop="goodsCollectCost">
          <el-input v-model="form.goodsCollectCost" placeholder="请输入宝贝收藏成本" />
        </el-form-item>
        <el-form-item label="宝贝收藏率" prop="goodsCollectRatio">
          <el-input v-model="form.goodsCollectRatio" placeholder="请输入宝贝收藏率" />
        </el-form-item>
        <el-form-item label="加购成本" prop="addPurchaseCost">
          <el-input v-model="form.addPurchaseCost" placeholder="请输入加购成本" />
        </el-form-item>
        <el-form-item label="拍下订单笔数" prop="orderNumber">
          <el-input v-model="form.orderNumber" placeholder="请输入拍下订单笔数" />
        </el-form-item>
        <el-form-item label="拍下订单金额" prop="orderAmount">
          <el-input v-model="form.orderAmount" placeholder="请输入拍下订单金额" />
        </el-form-item>
        <el-form-item label="直接收藏宝贝数" prop="directCollectGoodsNumber">
          <el-input v-model="form.directCollectGoodsNumber" placeholder="请输入直接收藏宝贝数" />
        </el-form-item>
        <el-form-item label="间接收藏宝贝数" prop="indirectCollectGoodsNumber">
          <el-input v-model="form.indirectCollectGoodsNumber" placeholder="请输入间接收藏宝贝数" />
        </el-form-item>
        <el-form-item label="优惠券领取量" prop="couponReceiveNumber">
          <el-input v-model="form.couponReceiveNumber" placeholder="请输入优惠券领取量" />
        </el-form-item>
        <el-form-item label="购物金充值笔数" prop="shopGoldRechargeNumber">
          <el-input v-model="form.shopGoldRechargeNumber" placeholder="请输入购物金充值笔数" />
        </el-form-item>
        <el-form-item label="购物金充值金额" prop="shopGoldRechargeAmount">
          <el-input v-model="form.shopGoldRechargeAmount" placeholder="请输入购物金充值金额" />
        </el-form-item>
        <el-form-item label="旺旺咨询量" prop="wangConsultNumber">
          <el-input v-model="form.wangConsultNumber" placeholder="请输入旺旺咨询量" />
        </el-form-item>
        <el-form-item label="引导访问量" prop="guideVisitNumber">
          <el-input v-model="form.guideVisitNumber" placeholder="请输入引导访问量" />
        </el-form-item>
        <el-form-item label="引导访问人数" prop="guideVisitPeopleNumber">
          <el-input v-model="form.guideVisitPeopleNumber" placeholder="请输入引导访问人数" />
        </el-form-item>
        <el-form-item label="引导访问潜客数" prop="guideVisitPotentialNumber">
          <el-input v-model="form.guideVisitPotentialNumber" placeholder="请输入引导访问潜客数" />
        </el-form-item>
        <el-form-item label="引导访问潜客占比" prop="guideVisitPotentialRatio">
          <el-input v-model="form.guideVisitPotentialRatio" placeholder="请输入引导访问潜客占比" />
        </el-form-item>
        <el-form-item label="入会率" prop="joinRate">
          <el-input v-model="form.joinRate" placeholder="请输入入会率" />
        </el-form-item>
        <el-form-item label="入会量" prop="joinNumber">
          <el-input v-model="form.joinNumber" placeholder="请输入入会量" />
        </el-form-item>
        <el-form-item label="引导访问率" prop="guideVisitRatio">
          <el-input v-model="form.guideVisitRatio" placeholder="请输入引导访问率" />
        </el-form-item>
        <el-form-item label="深度访问量" prop="depthVisitNumber">
          <el-input v-model="form.depthVisitNumber" placeholder="请输入深度访问量" />
        </el-form-item>
        <el-form-item label="平均访问页面数" prop="averageVisitPageNumber">
          <el-input v-model="form.averageVisitPageNumber" placeholder="请输入平均访问页面数" />
        </el-form-item>
        <el-form-item label="成交新客数" prop="dealNewOrderNumber">
          <el-input v-model="form.dealNewOrderNumber" placeholder="请输入成交新客数" />
        </el-form-item>
        <el-form-item label="成交新客占比" prop="dealNewOrderTatio">
          <el-input v-model="form.dealNewOrderTatio" placeholder="请输入成交新客占比" />
        </el-form-item>
        <el-form-item label="会员首购人数" prop="vipFirstBuyNumber">
          <el-input v-model="form.vipFirstBuyNumber" placeholder="请输入会员首购人数" />
        </el-form-item>
        <el-form-item label="会员成交金额" prop="vipDealAmount">
          <el-input v-model="form.vipDealAmount" placeholder="请输入会员成交金额" />
        </el-form-item>
        <el-form-item label="会员成交笔数" prop="vipDealNumber">
          <el-input v-model="form.vipDealNumber" placeholder="请输入会员成交笔数" />
        </el-form-item>
        <el-form-item label="成交人数" prop="dealPeopleNumber">
          <el-input v-model="form.dealPeopleNumber" placeholder="请输入成交人数" />
        </el-form-item>
        <el-form-item label="人均成交笔数" prop="perCapitaDealNumber">
          <el-input v-model="form.perCapitaDealNumber" placeholder="请输入人均成交笔数" />
        </el-form-item>
        <el-form-item label="人均成交金额" prop="perCapitaDealAmount">
          <el-input v-model="form.perCapitaDealAmount" placeholder="请输入人均成交金额" />
        </el-form-item>
        <el-form-item label="曝光新客数" prop="exposureNewPeopleNumber">
          <el-input v-model="form.exposureNewPeopleNumber" placeholder="请输入曝光新客数" />
        </el-form-item>
        <el-form-item label="进店新客数" prop="enterNewPeopleNumber">
          <el-input v-model="form.enterNewPeopleNumber" placeholder="请输入进店新客数" />
        </el-form-item>
        <el-form-item label="加购新客数" prop="addPurchaseNewPeopleNumber">
          <el-input v-model="form.addPurchaseNewPeopleNumber" placeholder="请输入加购新客数" />
        </el-form-item>
        <el-form-item label="收藏新客数" prop="collectNewPeopleNumber">
          <el-input v-model="form.collectNewPeopleNumber" placeholder="请输入收藏新客数" />
        </el-form-item>
        <el-form-item label="新客支付金额" prop="newPeoplePayAmount">
          <el-input v-model="form.newPeoplePayAmount" placeholder="请输入新客支付金额" />
        </el-form-item>
        <el-form-item label="新客点击率" prop="newPeopleClickRatio">
          <el-input v-model="form.newPeopleClickRatio" placeholder="请输入新客点击率" />
        </el-form-item>
        <el-form-item label="新客成交转化率" prop="newPeopleDealConversionRate">
          <el-input v-model="form.newPeopleDealConversionRate" placeholder="请输入新客成交转化率" />
        </el-form-item>
        <el-form-item label="自然流量转化金额" prop="natureConversionAmount">
          <el-input v-model="form.natureConversionAmount" placeholder="请输入自然流量转化金额" />
        </el-form-item>
        <el-form-item label="自然流量曝光量" prop="natureExposure">
          <el-input v-model="form.natureExposure" placeholder="请输入自然流量曝光量" />
        </el-form-item>
        <el-form-item label="备注" prop="remark">
          <el-input v-model="form.remark" placeholder="请输入备注" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { listUnboundedIndicators, getUnboundedIndicators, delUnboundedIndicators, addUnboundedIndicators, updateUnboundedIndicators, exportExcel } from "@/api/business/unboundedIndicators";
import ResizeMixin from "@/layout/mixin/ResizeHandler";

export default {
  name: "UnboundedIndicators",
  mixins: [ResizeMixin],
  data() {
    return {
      // div高度
      divHeight: 0,
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 无界指标数据表格数据
      unboundedIndicatorsList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        storeId: null,
        statDate: null,
        sceneId: null,
        sceneName: null,
        originalSceneId: null,
        originalSceneName: null,
        planId: null,
        planName: null,
        unitId: null,
        unitName: null,
        mainBodyId: null,
        mainBodyType: null,
        mainBodyName: null,
        impressions: null,
        clickNumber: null,
        spend: null,
        clickRatio: null,
        averageClickSpend: null,
        thousandShowSpend: null,
        totalPresaleAmount: null,
        totalPresaleNumber: null,
        directPresaleAmount: null,
        directPresaleNumber: null,
        indirectPresaleAmount: null,
        indirectPresaleNumber: null,
        directAmount: null,
        indirectAmount: null,
        totalAmount: null,
        totalNumber: null,
        directNumber: null,
        indirectNumber: null,
        clickConversionRate: null,
        inputOutputRatio: null,
        totalTransactionCost: null,
        totalShopCartNumber: null,
        directShopCartNumber: null,
        indirectShopCartNumber: null,
        addPurchaseRatio: null,
        collectGoodsNumber: null,
        collectStoreNumber: null,
        storeCollectCost: null,
        totalCollectAddNumber: null,
        totalCollectAddCost: null,
        goodsCollectAddNumber: null,
        goodsCollectAddCost: null,
        totalCollectNumber: null,
        goodsCollectCost: null,
        goodsCollectRatio: null,
        addPurchaseCost: null,
        orderNumber: null,
        orderAmount: null,
        directCollectGoodsNumber: null,
        indirectCollectGoodsNumber: null,
        couponReceiveNumber: null,
        shopGoldRechargeNumber: null,
        shopGoldRechargeAmount: null,
        wangConsultNumber: null,
        guideVisitNumber: null,
        guideVisitPeopleNumber: null,
        guideVisitPotentialNumber: null,
        guideVisitPotentialRatio: null,
        joinRate: null,
        joinNumber: null,
        guideVisitRatio: null,
        depthVisitNumber: null,
        averageVisitPageNumber: null,
        dealNewOrderNumber: null,
        dealNewOrderTatio: null,
        vipFirstBuyNumber: null,
        vipDealAmount: null,
        vipDealNumber: null,
        dealPeopleNumber: null,
        perCapitaDealNumber: null,
        perCapitaDealAmount: null,
        exposureNewPeopleNumber: null,
        enterNewPeopleNumber: null,
        addPurchaseNewPeopleNumber: null,
        collectNewPeopleNumber: null,
        newPeoplePayAmount: null,
        newPeopleClickRatio: null,
        newPeopleDealConversionRate: null,
        natureConversionAmount: null,
        natureExposure: null,
        status: null,
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        createTime: [
          { required: true, message: "创建时间不能为空", trigger: "blur" }
        ],
        createBy: [
          { required: true, message: "创建人不能为空", trigger: "blur" }
        ],
      }
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询无界指标数据列表 */
    getList() {
      this.loading = true;
      listUnboundedIndicators(this.queryParams).then(response => {
        this.unboundedIndicatorsList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        id: null,
        storeId: null,
        statDate: null,
        sceneId: null,
        sceneName: null,
        originalSceneId: null,
        originalSceneName: null,
        planId: null,
        planName: null,
        unitId: null,
        unitName: null,
        mainBodyId: null,
        mainBodyType: null,
        mainBodyName: null,
        impressions: null,
        clickNumber: null,
        spend: null,
        clickRatio: null,
        averageClickSpend: null,
        thousandShowSpend: null,
        totalPresaleAmount: null,
        totalPresaleNumber: null,
        directPresaleAmount: null,
        directPresaleNumber: null,
        indirectPresaleAmount: null,
        indirectPresaleNumber: null,
        directAmount: null,
        indirectAmount: null,
        totalAmount: null,
        totalNumber: null,
        directNumber: null,
        indirectNumber: null,
        clickConversionRate: null,
        inputOutputRatio: null,
        totalTransactionCost: null,
        totalShopCartNumber: null,
        directShopCartNumber: null,
        indirectShopCartNumber: null,
        addPurchaseRatio: null,
        collectGoodsNumber: null,
        collectStoreNumber: null,
        storeCollectCost: null,
        totalCollectAddNumber: null,
        totalCollectAddCost: null,
        goodsCollectAddNumber: null,
        goodsCollectAddCost: null,
        totalCollectNumber: null,
        goodsCollectCost: null,
        goodsCollectRatio: null,
        addPurchaseCost: null,
        orderNumber: null,
        orderAmount: null,
        directCollectGoodsNumber: null,
        indirectCollectGoodsNumber: null,
        couponReceiveNumber: null,
        shopGoldRechargeNumber: null,
        shopGoldRechargeAmount: null,
        wangConsultNumber: null,
        guideVisitNumber: null,
        guideVisitPeopleNumber: null,
        guideVisitPotentialNumber: null,
        guideVisitPotentialRatio: null,
        joinRate: null,
        joinNumber: null,
        guideVisitRatio: null,
        depthVisitNumber: null,
        averageVisitPageNumber: null,
        dealNewOrderNumber: null,
        dealNewOrderTatio: null,
        vipFirstBuyNumber: null,
        vipDealAmount: null,
        vipDealNumber: null,
        dealPeopleNumber: null,
        perCapitaDealNumber: null,
        perCapitaDealAmount: null,
        exposureNewPeopleNumber: null,
        enterNewPeopleNumber: null,
        addPurchaseNewPeopleNumber: null,
        collectNewPeopleNumber: null,
        newPeoplePayAmount: null,
        newPeopleClickRatio: null,
        newPeopleDealConversionRate: null,
        natureConversionAmount: null,
        natureExposure: null,
        createTime: null,
        createBy: null,
        updateTime: null,
        updateBy: null,
        status: null,
        remark: null
      };
      this.$resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.$resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加无界指标数据";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const id = row.id || this.ids
      getUnboundedIndicators(id).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改无界指标数据";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.id != null) {
            updateUnboundedIndicators(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addUnboundedIndicators(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$modal.confirm('是否确认删除无界指标数据编号为"' + ids + '"的数据项？').then(function() {
        return delUnboundedIndicators(ids);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
    },
    /** 导出按钮操作 */
    handleExport() {
      exportExcel(this.queryParams)
    }
  }
};
</script>
